package com.smartstate.dataManagement.bo;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@TableName("login_log")
@ApiModel(value = "LoginLog",description = "登录日志")
public class LoginLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "登录账户")
    private String  username;

    @ApiModelProperty(value = "部门")
    private String  department;

    @ApiModelProperty(value = "姓名")
    private String  nickname;

    @ApiModelProperty(value = "登录时间")
    private String  loginTime;

    @ApiModelProperty(value = "IP")
    private String  ip;

    @ApiModelProperty(value = "区域")
    private String  area;

    @ApiModelProperty(value = "浏览器")
    private String  browser;

    @ApiModelProperty(value = "创构时间")
    private String createTime;

    @ApiModelProperty(value = "创建人")
    private String  createUser;

    public LoginLog(){

    }
    public LoginLog(LoginLogBuilder loginLogBuilder){
        this.id=loginLogBuilder.id;
        this.username=loginLogBuilder.username;
        this.department=loginLogBuilder.department;
        this.nickname=loginLogBuilder.nickname;
        this.loginTime=loginLogBuilder.loginTime;
        this.ip=loginLogBuilder.ip;
        this.area=loginLogBuilder.area;
        this.browser=loginLogBuilder.browser;
        this.createTime=loginLogBuilder.createTime;
        this.createUser=loginLogBuilder.createUser;

    }

    public  static class LoginLogBuilder {
        @ApiModelProperty(value = "id")
        private String id;

        @ApiModelProperty(value = "登录账户")
        private String  username;

        @ApiModelProperty(value = "部门")
        private String  department;

        @ApiModelProperty(value = "姓名")
        private String  nickname;

        @ApiModelProperty(value = "登录时间")
        private String  loginTime;

        @ApiModelProperty(value = "IP")
        private String  ip;

        @ApiModelProperty(value = "区域")
        private String  area;

        @ApiModelProperty(value = "浏览器")
        private String  browser;

        @ApiModelProperty(value = "创建时间")
        private String  createTime;

        @ApiModelProperty(value = "创建人")
        private String  createUser;

        public LoginLogBuilder setUsername(String username) {
            this.username = username;
            return this;
        }

        public LoginLogBuilder setDepartment(String department) {
            this.department = department;
            return  this;
        }

        public LoginLogBuilder setNickname(String nickname) {
            this.nickname = nickname;
            return  this;
        }

        public LoginLogBuilder setLoginTime(String loginTime) {
            this.loginTime = loginTime;
            return  this;
        }

        public LoginLogBuilder setIp(String ip) {
            this.ip = ip;
            return  this;
        }

        public LoginLogBuilder setArea(String area) {
            this.area = area;
            return  this;
        }

        public LoginLogBuilder setBrowser(String browser) {
            this.browser = browser;
            return  this;
        }

        public LoginLogBuilder setCreateTime(String createTime) {
            this.createTime = createTime;
            return this;
        }

        public LoginLogBuilder setCreateUser(String createUser) {
            this.createUser = createUser;
            return this;
        }

        public LoginLog getLoginLog(){
            return  new LoginLog(this);
        }
    }



}
